///PHILOTES Source Code.  (C)2012 PhiloLabs
#pragma once


#ifndef __SimpleSpline_H__
#define __SimpleSpline_H__

#include "OgrePrerequisites.h"
#include "math/vector3.h"
#include "math/matrix4.h "

namespace Ogre {


	
	
	
	class _OgreExport SimpleSpline
    {
    public:
        SimpleSpline();
        ~SimpleSpline();

        
        void addPoint(const Vector3& p);

        
        const Vector3& getPoint(unsigned short index) const;

        
        unsigned short getNumPoints(void) const;

        
        void clear(void);

        
        void updatePoint(unsigned short index, const Vector3& value);

        
        Vector3 interpolate(Real t) const;

        
        Vector3 interpolate(unsigned int fromIndex, Real t) const;


        
        void setAutoCalculate(bool autoCalc);

        
        void recalcTangents(void);

    protected:

        bool mAutoCalc;

        vector<Vector3>::type mPoints;
        vector<Vector3>::type mTangents;

        /// Matrix of coefficients 
        Matrix4 mCoeffs;



    };

	
	

}


#endif

